<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="common/taglibs.jsp"%>
<%@include file="common/_head.jsp"%>
<html>
<head>
    <title>觅蜜交友渠道后台管理-登录</title>
    <link href="<%=path%>/assets/layuiadmin/style/login.css?v=1" rel="stylesheet">
    <style>
        .layui-form-checkbox span {
            height: auto;
        }
        body{
            background: url("https://mm-friend.oss-cn-shenzhen.aliyuncs.com/data/admin/cps_admin_bg.png") no-repeat center center;
            background-size:cover;
            position:fixed;
            top:0;
            left:0;
            width:100%;
            height:100%;
        }
    </style>
</head>
<body layadmin-themealias="default">
<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

    <div class="layadmin-user-login-main">
        <div class="layadmin-user-login-box layadmin-user-login-header">
            <h2 style="color: #FC8527;">觅蜜交友</h2>
            <p>渠道后台管理</p>
        </div>
        <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="username"></label>
                <input type="text" name="username" id="username" lay-verify="required" placeholder="用户名" class="layui-input">
            </div>
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="password"></label>
                <input type="password" name="password" id="password" lay-verify="required" placeholder="密码" class="layui-input">
            </div>
            <div class="layui-form-item" style="margin-bottom: 20px;">
                <input id="remberme" type="checkbox" name="remember" lay-skin="primary" title="记住密码"><div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span style="height: auto !important;">记住密码</span><i class="layui-icon layui-icon-ok"></i></div>
                <%--<a href="https://www.layui.com/admin/std/dist/views/user/forget.html" class="layadmin-user-jump-change layadmin-link" style="margin-top: 7px;">忘记密码？</a>--%>
            </div>
            <div class="layui-form-item">
                <button class="layui-btn layui-btn-fluid" lay-submit="" lay-filter="login-submit">登 入</button>
            </div>
        </div>
    </div>
</div>
<script>
    layui.config({
        base: '<%=path%>/assets/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'user'], function(){
        var $ = layui.$ ,form = layui.form;

        form.render();

        //提交
        form.on('submit(login-submit)', function(obj) {
            $.ajax({
                url: '<%=basePath%>/login',
                data: obj.field,
                type: "post",
                success: function (data) {
                    if (data.code == 0) {
                        location.href = "toDashboard";
                    } else {
                        layer.msg(data.msg);
                    }
                }
            });
        });
    });
</script>

</body>
</html>
